package com.example.springboot_study.dao.primary;

import com.example.springboot_study.entity.primary.User;
import org.apache.ibatis.annotations.*;

/**
 * @author : liqun
 * @createTime : 2021/9/16 15:24
 */
@Mapper
public interface UserMapperPrimary {
    @Select("SELECT * FROM USER WHERE NAME = #{name}")
    User findByName(@Param("name") String name);

    @Insert("INSERT INTO USER(NAME, AGE) VALUES(#{name}, #{age})")
    int insert(@Param("name") String name, @Param("age") Integer age);

    @Delete("DELETE FROM USER")
    int deleteAll();

}
